package com.zfskkk.democonsumer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author zhangfoshou
 * @date 2018/9/28 17:41
 */
@RestController
public class HelloController {

    @Autowired
    RestTemplate restTemplate;

    @RequestMapping("/abc")
    public String hello(@RequestParam(name = "name", defaultValue = "zzzz") String name) {
        return restTemplate.getForObject("http://service-provider/actuator/info?name=" + name, String.class);
    }
}
